/**
 * @scope enchant.JGZ.Dialog.prototype
 */
enchant.JGZ.Box = enchant.Class.create(enchant.Sprite, {
  /**
   * Dialogの表示を行う
   * @constructs
   * @param {Object} opt {x: X座標, y: Y座標, renderPosition: 表示位置の指定}
   */
  initialize : function(opt) {
    Sprite.call(this, 340, 200);

    var game    = enchant.Game.instance;
    this.image  = game.assets[LIB_IMAGE_PATH + 'bg_dialog.png'];

    if (opt.renderPosition !== undefined) {
      switch (opt.renderPosition) {
      case 'center' :
        var position = new enchant.JGZ.MathPosition();
        position.setCenter({
          'type'    : opt.renderPosition,
          'selfW'   : 340,
          'selfH'   : 200,
          'targetW' : game.width,
          'targetH' : game.height,
          'targetX' : 0,
          'targetY' : 0
        });
      }

      this.x = position.x;
      this.y = position.y;
    } else {
      this.x      = opt.x;
      this.y      = opt.y;
    }
  }
});
